package com.ehi.common.jersey;

import com.ehi.common.jersey.filter.NoCacheControlFilter;
import com.ehi.common.jersey.status.DefaultExceptionMapper;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.ServerProperties;

public abstract class AbstractApplication extends ResourceConfig {

    public AbstractApplication() {
        //register(RequestContextFilter.class);
        property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
        register(JacksonFeature.class);
        register(DefaultExceptionMapper.class);
        register(NoCacheControlFilter.class);

        registerComponents();
        registerApis();
    }

    protected abstract void registerApis();

    protected void registerComponents() {
    }

}
